#ifdef GL_ES
precision mediump float;
#endif

uniform vec2 u_resolution;
uniform float u_time;

float circle(vec2 uv,vec2 center,float d){
    return length(uv-center)-d;
}
float cloud(vec2 uv,vec2 center,float d){
    float step=1.2;
    float c1=circle(uv,vec2(center.x-d*.9*1.*step,center.y),d*.9);
    float c2=circle(uv,vec2(center.x-d*.8*2.*step,center.y),d*.8);
    float c3=circle(uv,vec2(center.x,center.y),d);
    float c4=circle(uv,vec2(center.x+d*.9*1.*step,center.y),d*.9);
    float c5=circle(uv,vec2(center.x+d*.8*2.*step,center.y),d*.8);
    return min(c5,min(c4,min(c3,min(c1,c2))));
}
void main(){
    vec2 uv=gl_FragCoord.xy/u_resolution;
    uv.x+=u_time*.3;
    uv.x=fract(uv.x);
    float d=cloud(uv,vec2(.5,.5),.05);
    d=1.-step(0.,d);
    vec3 color=vec3(d);
    gl_FragColor=vec4(color,1.);
}